/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.kliento.frames;

import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.border.EtchedBorder;
import org.kliento.panels.ClientsPanel;

/**
 *
 * @author athos
 */
public class MainFrame extends JFrame
{
    
    private JMenuBar mainBar = new JMenuBar();
    private JMenu visual = new JMenu("Visual");
    private JMenu about = new JMenu("Sobre");
    private CardLayout card = new CardLayout(0, 0);
    private JPanel mainPanel = new JPanel(card);
    

    public MainFrame()
    {
        setLayout(new GridBagLayout());
        setDefaultCloseOperation(this.DISPOSE_ON_CLOSE);
        setJMenuBar(mainBar);
        setSize(800, 600);
        initComps();
        setVisible(true);
        
    }
    
    private void initComps()
    {
        mainBar.add(visual);
        mainBar.add(about);
        mainPanel.setBorder(new EtchedBorder());
        add(mainPanel, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.FIRST_LINE_START,
                GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
        mainPanel.add(new ClientsPanel(), "clientes");
        card.show(mainPanel, "clientes");
        
    }
    
    public static void main (String [] args)
    {
        new MainFrame();
    }
    
    
    
}
